
import LineManager from "./LineManager"
import NodeManager from "./NodeManager"
import { imageLoad, insertDom } from "./util"
class LeafManager {
    constructor(data, container, option, deg, imageList, index) {
        this.init(data, container, option, deg, imageList, index)
    }

    init(data, container, option, deg, imageList, index) {
        const { nodeGroup, lineGroup } = container
        this.node = new NodeManager(data, nodeGroup, option, deg)
        this.line = new LineManager(data, lineGroup, option, deg, imageList, index)
        this.initContent(data, option)
    }

    initContent(data, option) {
        const renderFun = data.render || option.render
        if (renderFun) {
            renderFun(this.node.returnWrapper(), data)
        }
        this.node.setAngle()
    }
}

export default LeafManager